1. Fixed the bug in Rule editing.
2. view the added results in detail
3. cpath engine and nquery support numerical Selection
4. Add a Help Page
5. Add two collection templates and mixed collection templates in the mode.
6. Added Multiple Functions
Only you know the character concept and are familiar with jquery syntax, you will use the EMU collection tool to quickly collect webpage content
A nquery s
turn on the Profiling function To optimize for slow queries: MongoDB can monitor data through profile to optimize it.To see whether the profile function is currently open with commandsDb.getprofilinglevel () returns level with a value of 0|1|2, meaning: 0 for off, 1 for slow command, 2 for allDb.setprofilinglevel (level); #level等级, value ibid.At level 1, the slow command defaults to 100ms and changes to Db.setprofilinglevel (LEVEL,SLOWMS) such as Db.setprofilinglevel (1,50) to 50 milliseconds.V
Pagination using Laypage is relatively simple but full-featured, database access using Petapoco,bootstrap is Flatlab template, using MVC repository model.
First, a picture of the effect;
below to see the concrete implementation;
Controller:
Public ActionResult Index ()
{return
View ();
}
Repository
Public page
Js:
var users = {lpage:function (query) {var self = this; var url = '/test/list?r= ' + math.random (); $.get (URL, query, fun Ction (h) {//get request
currently turned on with Command Db.getprofilinglevel () returns level, value 0|1|2, meaning: 0 for close, 1 for record slow command, 2 for all Start profile function for Db.setprofilinglevel (level); #level等级, when the value is 1, the slow command defaults to 100ms and changes to Db.setprofilinglevel (LEVEL,SLOWMS) such as Db.setprofilinglevel (1,50) This changes to 50 milliseconds to view the current monitoring log through Db.system.profile.find ().> Db.system.profile.find ({millis:{$gt:"ts":
default value is 100 ms. Of course, the default value is ms. The setting method and level are the same. One is to add the-slowms startup parameter configuration. The second parameter is added when dB. setprofilinglevel is called:
DB. setprofilinglevel (1, 10 );
Query profiling records
Unlike the slow query log of MySQL, The MongoDB profile record exists directly in the system dB, and the record location is system. profile, so we only need to query the records of this collection to get our prof
The master/slave (master/slave) default engine is inconsistent, causing the replication to fail. The colleague told me that the replication of one slave server is interrupted. Check the slave server with the following Error: 'specified key was too long; max keylength is 1000 bytes 'on query mysql> show slave status \ G; * *************************** 1. row ************************* Slave_IO_State: Waiting formaster to send event Master_Host: 192. xxx. xxx.146 Master_User: repl Master_Port: 3306
({millis:{$gt:}})
{"TS": Isodate ("2011-07-23t02:50:13.941z"), "info": "Query Order.order reslen:11022 nscanned:672230 \nquery: {status:1.0} nreturned:101 bytes:11006 640ms "," Millis ": 640}
The meaning of this value is
TS: Command Execution timeInfo: The contents of the commandQuery: Representing queriesOrder.order: A library and collection that represents a queryReslen: The result set size returned, the byte numbernscanned: Number of scan
callback function, it invokes the callback function of the parameter before calling the route handler, and can register multiple callback functions for a route.Use App.param (param,function (req,res,next,value) {}) to implement a callback function for the defined parameters.PARAM: The parameter name definedNest: callback function for the next App.param () callback that is registered. You must call next () in the callback function, or the callback chain will be corrupted.Value: The values of the
t, you can see that although both approaches get the same results, they use radically different amounts of resources:
Create Table tasselect dbms_random.value (100000) ID, rpad ('*', 40, '*') data from dualconnect by level
And then run your top-N query with rownum:
Select * from (select * from t order by ID) Where rownum
And finally run a "do-it-yourself" query that fetches just the first 10 records:
Declarecursor C isselect * from t order by ID; l_rec C % rowtype; begin open C; for
); # level. The value is the same as above. When the level is 1, the default value of the slow command is 100 ms, Which is changed to DB. setprofilinglevel (Level, slowms), such as DB. setprofilinglevel (), which is changed to 50 ms.
View the current monitoring log through dB. system. profile. Find (). Parameter Analysis:
If it is found that the time is long, optimization is required. For example, if the nscanned number is large or close to the total number of records, the index query may not b
thought to be a read string, the function can follow the specified delimiter to read the string stream;istream Getline (istream is, string str, char Delim)istream Getline (istream is, string str);To implement the parse URL:Code: URL is http://www.baidu.com:80/query?k1=v1k2=v2
void parseURL (String url) {
StringStream SS (URL); Sstream header File
String field;
while (Getline (Ss,field, ': ')) {
Res.push_back (field);
cout
}
String host = Res[1];
int pos = host.find_first_not
o'clock, so what is this slow definition? Above we say that the default is the 100ms, of course there are settings, there are two ways to set the method and level, one is to add the –slowms boot parameter configuration. The second is to add the second parameter when calling Db.setprofilinglevel:Db.setprofilinglevel (1, 10);Query Profiling RecordsUnlike MySQL's slow query log, MongoDB profile records are directly present in the system DB, recording location system.profile, so we can only query t
Tb_name WHERE address Note:Query Top N RecordsSELECT * from Tb_name LIMIT 0, $N;The limit statement is used in conjunction with other statements, such as an order by, and uses a variety of SQL statements to make the program very flexibleQuery after N recordsSELECT * from Tb_stu ORDER by ID ASC LIMIT $nQuery n records starting at a specified locationSELECT * from Tb_stu ORDER by ID ASC LIMIT $_post[begin], $nNote: The ID of the data is starting from 0
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.